package com.example.nbug.component;

import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 统一返回封装类
 * @author: 杰
 * @date: 2024/7/20 21:57
 */
@Data
public class ApiResponse<T> implements Serializable {
    @Serial
    private static final long serialVersionUID = -8185129712846835285L;

    private int code;
    private T data;
    private String message;

    public ApiResponse(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public ApiResponse(int code, String message) {
        this(code,null,message);
    }
}
